package cn.jh.clearing.business;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import cn.jh.clearing.pojo.DistributionRecord;
import cn.jh.clearing.pojo.ProfitRecord;

public interface ProfitRecordBusiness {

	
	Page<ProfitRecord> findProfitByUserid(long userid, Pageable pageAble);
	
	Page<ProfitRecord> findProfitByUserid(String userid, String grade, Date startTime, Date endTime, Pageable pageAble);
	
	public Page<ProfitRecord> findProfitByBrandId(long brandid, String userid, String grade, Date startTime,
                                                  Date endTime, Pageable pageAble);
	
	public  ProfitRecord merge(ProfitRecord profitRecord);
	
	public  BigDecimal findsumProfitRecord(long acquserid);
	
	public  DistributionRecord merge(DistributionRecord profitRecord);
	
	Page<DistributionRecord> findDistributionRecordByUserid(long userid, Date startTime, Date endTime, Pageable pageAble);
	
	Page<DistributionRecord> findDistributionRecordByPlatform(long brandid, String userid, String order_code, Date startTime, Date endTime, Pageable pageAble);
	
	
	public  ProfitRecord  queryProfitRecordByordercode(String ordercode, String type);
	
	//获取当前phone的数据库记录(oriphone为需要查询的手机号)
	public List<ProfitRecord> queryProfitByOriPhone(String oriphone, String ordercode);
	//依据ordercode获取分润表中的订单信息
	public List<ProfitRecord> queryProfitAmount(String ordercode);
	//依据phone获取用户所有返佣信息
	public List<DistributionRecord> findAllDistributionByPhone(String acqphone, Date startTime, Date endTime, Pageable pageable);

	Page<ProfitRecord> findProfitByUserid(String orderCode, Date startTimeDate, Date endTimeDate,
                                          Pageable pageable);

	List<Object[]> findsumProfitRecordByAcqUserIds(long[] acqUserIds);
	
}
